package com.che.software.testato.domain.dao;

import java.util.List;

import com.che.software.testato.domain.dao.jdbc.exception.ElementCreationDAOException;
import com.che.software.testato.domain.dao.jdbc.exception.ElementSearchDAOException;
import com.che.software.testato.domain.entity.Element;
import com.che.software.testato.domain.entity.creation.ElementCreation;
import com.che.software.testato.domain.entity.creation.TransitionCreation;
import com.che.software.testato.domain.entity.search.ElementSearch;

/**
 * DAO interface dedicated to the elements management.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public interface IElementDAO {

	/**
	 * Creates a procedural diagram from a testCaseId, a set of elements and a
	 * set of transitions. If activities have been reused or not to create this
	 * diagram.
	 * 
	 * @param testCaseId the test case id.
	 * @param elements the set of elements.
	 * @param transitions the set of transitions.
	 * @throws ElementCreationDAOException if an error occurs during the
	 *         creation.
	 */
	public void createDiagram(int testCaseId, List<ElementCreation> elements, List<TransitionCreation> transitions) throws ElementCreationDAOException;

	/**
	 * Checks if some element have been setted for a given case test. In other
	 * words, is able to say if a procedural diagram has already been setted or
	 * not.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param testCaseId the case test id.
	 * @return true if the procedural diagram has already been setted, else
	 *         false.
	 * @since July, 2011.
	 * @throws ElementSearchDAOException if an error occurs during the search.
	 */
	public boolean isElementExistingFromCaseTestId(int testCaseId) throws ElementSearchDAOException;

	/**
	 * Element search from a bean of criterions.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param searchBean the criterions to use for the search.
	 * @return the resulting object list.
	 * @since July, 2011.
	 * @throws ElementSearchDAOException if an error occurs during the search.
	 */
	public List<Element> searchElement(ElementSearch searchBean) throws ElementSearchDAOException;
}